package person.model;

public class Person
{
    private int id;
    private int age;
    private String fName;
    private String lName;
    private String sex;

    public Person()
    {
	id = 0;
	age = 0;
	fName = null;
	lName = null;
	sex = null;
    }

    public Person(int age, String fName, String lName, String sex)
    {
	this.age = age;
	this.fName = fName;
	this.lName = lName;
	this.sex = sex;
    }

    public Person(int id, int age, String fName, String lName, String sex)
    {
	this(age, fName, lName, sex);
	this.id = id;
    }

    public int getId()
    {
	return id;
    }

    public void setId(int id)
    {
	this.id = id;
    }

    public int getAge()
    {
	return age;
    }

    public void setAge(int age)
    {
	this.age = age;
    }

    public String getfName()
    {
	return fName;
    }

    public void setfName(String fName)
    {
	this.fName = fName;
    }

    public String getlName()
    {
	return lName;
    }

    public void setlName(String lName)
    {
	this.lName = lName;
    }

    public String getSex()
    {
	return sex;
    }

    public void setSex(String sex)
    {
	this.sex = sex;
    }

   
    @Override
    public String toString()
    {		
	return id + ";" + fName + ";" + lName + ";" + age + ";" + sex;
    }

    // auto generation
    @Override
    public int hashCode()
    {
	final int prime = 31;
	int result = 1;
	result = prime * result + age;
	result = prime * result + ((fName == null) ? 0 : fName.hashCode());
	result = prime * result + id;
	result = prime * result + ((lName == null) ? 0 : lName.hashCode());
	result = prime * result + ((sex == null) ? 0 : sex.hashCode());
	return result;
    }
 // auto generation
    @Override
    public boolean equals(Object obj)
    {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (getClass() != obj.getClass())
	    return false;
	Person other = (Person) obj;
	if (age != other.age)
	    return false;
	if (fName == null)
	{
	    if (other.fName != null)
		return false;
	}
	else if (!fName.equals(other.fName))
	    return false;
	if (id != other.id)
	    return false;
	if (lName == null)
	{
	    if (other.lName != null)
		return false;
	}
	else if (!lName.equals(other.lName))
	    return false;
	if (sex == null)
	{
	    if (other.sex != null)
		return false;
	}
	else if (!sex.equals(other.sex))
	    return false;
	return true;
    }

}
